Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ConfigReader): Use CLI options with default config file #404

Merged
merged 3 commits into from
Oct 3, 2017

Conversation

Be-ngt-oH
Copy link
Contributor

Change ConfigReader behavior to always use stryker.conf.js if present. CLI
options override options from the file.

Run does not fail anymore if a CLI option, but no config file is specified.
closes #390

Change ConfigReader behavior to always use stryker.conf.js if present. CLI
options override options from the file.

Run does not fail anymore if a CLI option, but no config file is specified.
closes stryker-mutator#390
Copy link
Member

@nicojs nicojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I still have some small remarks.


if (!this.cliOptions.configFile) {
try {
fs.accessSync(`${process.cwd()}/${DEFAULT_CONFIG_FILE}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's cleaner to use path.resolve(`./${DEFAULT_CONFIG_FILE}`) here.

log.info(`Using ${DEFAULT_CONFIG_FILE} in the current working directory.`);
this.cliOptions.configFile = DEFAULT_CONFIG_FILE;
} catch (e) {
log.info('No config file specified. Running with command line arguments.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also add a message: 'Use `stryker init` command to generate your config file' here? So we help the end user even more?

@simondel
Copy link
Member

simondel commented Oct 2, 2017

Awesome! You got #404 🥇

Display 'Use `stryker init` command to generate your config file.' when stryker is run without a config file.
@nicojs nicojs merged commit 99cdc61 into stryker-mutator:master Oct 3, 2017
@nicojs
Copy link
Member

nicojs commented Oct 3, 2017

Thanks @Be-ngt-oH . Awesome job 🥇

@Be-ngt-oH Be-ngt-oH deleted the fix-cli-config-file branch October 3, 2017 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make stryker config file mandatory
3 participants